#include<stdio.h>


void Swap(int* x, int* y)
{
	int tmp = *x;
	*x = *y;
	*y = tmp;
}
void BubbleSort(int* arr, int n)
{
	for (int i = 0; i < n; i++)
	{
		int cnt = 0;
		for (int j = 0; j < n - i - 1; j++)
		{
			if (arr[j] > arr[j + 1])
			{
				cnt = 1;
				Swap(&arr[j], &arr[j + 1]);

			}
		}
		if (cnt == 0)
			break;
	}
}

int main()
{
	int arr[10] = { 6, 3, 9, 5, 2, 4, 0, 1, 10, 3};
	int n = sizeof(arr) / sizeof(arr[0]);
	BubbleSort(arr, n);
	for (int i = 0; i < n; i++)
	{
		printf("%d ", arr[i]);
	}
	return 0;
}